//
// Created by 小演员的MacBook on 2024/6/30.
//

#include <iostream>
using namespace std;

int ga = 10;

int main() {

    int a = 10;
    int c = 10;
    int b[10];
    int *d = new int(10);
    int *e = new int[10];
    ga = 20;

    cout << "ga: " << &ga << endl;//分配在全局区
    cout << "a: " << &a << endl;//分配在栈区
    cout << "c: " << &c << endl;//分配在栈区
    cout << "b: " << &b << endl;//分配在栈区
    cout << "d: " << &d << endl;//分配在栈区
    cout << "d: " << d << endl;//分配在堆区
    cout << "e: " << &e << endl;//分配在栈区
    cout << "e: " << e << endl;//分配在堆区
    delete d;
    delete[] e;

    return 0;
}